/** 
 * Project Name:kaka 
 * File Name:PicInfoServiceImpl.java 
 * Package Name:com.luoran.kaka.service.impl 
 * Date:2018年11月22日下午4:20:04 
 * Copyright (c) 2018, Luoran, Inc. All Rights Reserved.
 * 
 */  
package com.luoran.kaka.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.luoran.kaka.dao.IPicInfoDao;
import com.luoran.kaka.entity.PicInfo;
import com.luoran.kaka.service.IPicInfoService;

/** 
 * ClassName: PicInfoServiceImpl
 * date: 2018年11月22日 下午4:20:04
 * @author ghl 
 * @since JDK 1.8
 */
@Service
public class PicInfoServiceImpl implements IPicInfoService {
	
	
	@Autowired
	private IPicInfoDao picInfoDao;

	/** 
	 * @see com.luoran.kaka.service.IPicInfoService#insertPic(com.luoran.kaka.entity.PicInfo) 
	 * @param pic
	 * @return
	 * @author ghl 2018年11月22日下午4:20:04
	 * insertPic: 插入图片返回主键
	 */
	@Override
	public String insertPic(PicInfo pic) {
		picInfoDao.insertTemplate(pic);
		return pic.getId();
	}

	/** 
	 * @see com.luoran.kaka.service.IPicInfoService#getPicInfoById(java.lang.String) 
	 * @param picId
	 * @return
	 * @author ghl 2018年11月25日下午10:58:52
	 * getPicInfoById:
	 */  
	@Override
	public PicInfo getPicInfoById(String picId) {
		return picInfoDao.single(picId);
	}

	/* 
	 * updateById: 根据主键修改图片
	 */
	@Override
	public int updateById(PicInfo pic) {
		return picInfoDao.updateById(pic);
	}

	/* 
	 * listBybasicId:
	 */
	@Override
	public List<PicInfo> listBybasicId(String basicId) {
		return picInfoDao.listBybasicId(basicId);
	}

	

}
